$OpenBSD: patch-appl_xnlock_xnlock_c,v 1.1 2014/07/13 14:10:13 ajacoutot Exp $

Use HAVE_ARC4RANDOM and choose to call arc4random() instead of srand()
and rand() and friends.

--- appl/xnlock/xnlock.c.orig	Sun Dec  9 23:06:44 2012
+++ appl/xnlock/xnlock.c	Thu Apr 24 15:41:58 2014
@@ -377,7 +377,9 @@ walk(int dir)
 static long
 my_random (void)
 {
-#ifdef HAVE_RANDOM
+#if defined (HAVE_ARC4RANDOM)
+    return arc4random();
+#elif defined (HAVE_RANDOM)
     return random();
 #else
     return rand();
@@ -938,7 +940,9 @@ main (int argc, char **argv)
       strlcpy(login, pw->pw_name, sizeof(login));
     }
 
-#if defined(HAVE_SRANDOMDEV)
+#if defined(HAVE_ARC4RANDOM)
+    /* do nothing */
+#elif defined(HAVE_SRANDOMDEV)
     srandomdev();
 #elif defined(HAVE_RANDOM)
     srandom(time(NULL));
